<form> <input type="text" pattern="([0-9]{2}[/]?){2}" /> <input type="submit"> title="Enter a date in this format MM/YY" </form> Run code snippetHide results